'\" te
.\" Copyright (c) 2002, Sun Microsystems, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH KVM_NLIST 3KVM "May 13, 2017"
.SH NAME
kvm_nlist \- get entries from kernel symbol table
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lkvm\fR [ \fIlibrary\fR\&.\|.\|.]
#include <kvm.h>
#include <nlist.h>

\fBint\fR \fBkvm_nlist\fR(\fBkvm_t *\fR\fIkd\fR, \fBstruct nlist *\fR\fInl\fR);
.fi

.SH DESCRIPTION
.LP
The \fBkvm_nlist()\fR function examines the symbol table from the kernel image
identified by \fIkd\fR (see \fBkvm_open\fR(3KVM)) and selectively extracts a
list of values and puts them in the array of \fBnlist\fR structures pointed to
by \fInl\fR. The name list pointed to by \fInl\fR consists of an array of
structures containing names, types and values.  The \fBn_name\fR field of each
such structure is taken to be a pointer to a character string representing a
symbol name.  The list is terminated by an entry with a null pointer (or a
pointer to a null string) in the \fBn_name\fR field.  For each entry in
\fInl\fR, if the named symbol is present in the kernel symbol table, its value
and type are placed in the \fBn_value\fR and \fBn_type\fR fields. If a symbol
cannot be located, the corresponding \fBn_type\fR field of \fInl\fR is set to
0.
.SH RETURN VALUES
.LP
The \fBkvm_nlist()\fR functions returns the value of \fBnlist\fR(3ELF).
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Stable
_
MT-Level	Unsafe
.TE

.SH SEE ALSO
.LP
.BR nlist (3ELF),
.BR kvm_kread (3KVM),
.BR kvm_open (3KVM),
.BR attributes (7)
.SH NOTES
.LP
Although the \fBlibkvm\fR API is Stable, the symbol names and data values that
can be accessed through this set of interfaces are Private and are subject to
ongoing change.
